var request = require('request');
function post(url,data){
    return new Promise((resolve,reject)=> {
        request({
            url: url,
            method: "POST",
            json: true,
            headers: {
                "Content-Type": "application/x-www-form-urlencoded",
            },
            form: data
        }, function (error, response, body) {
            if (!error && response.statusCode == 200) {
                resolve(body);
            } else {
                reject(error)
            }
        })
    })
}
module.exports = post;